fix(memos-local-plugin): detect Hermes chat with global flags#1951
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the memos-local-plugin bridge’s daemon-mode “Hermes chat running” detection to handle Hermes global CLI flags appearing before the chat subcommand, and adds a unit test to cover the expected matching cases.
Changes:
- Replaced the
pgrep -f "hermes chat"fixed-string match with a configurable pattern constant used byisHermesChatRunning(). - Added a unit test covering: standard
hermes chat, global flags beforechat, and non-chat Hermes commands.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/memos-local-plugin/bridge.cts | Introduces a reusable process-match pattern and uses it for pgrep-based Hermes chat detection. |
| apps/memos-local-plugin/tests/unit/bridge-status.test.ts | Adds a focused unit test validating Hermes chat process detection behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }; | ||
| } | ||
|
|
||
| const HERMES_CHAT_PROCESS_PATTERN = "hermes(?:\\s+\\S+)*\\s+chat\\b"; |
| const escapedPattern = match!.groups!.pattern; | ||
| const pattern = escapedPattern.replaceAll("\\\\", "\\"); | ||
| return new RegExp(pattern).test(command); |
|
AutoDev follow-up for closure audit:
Conclusion: conflict resolved and cloud test passed. GitHub mergeability/checks are recalculating after the push; please wait for branch protection/review before merge. |
…idge-status-20260621090430
|
AutoDev follow-up update: After
Conclusion: conflict remains resolved on latest |
Summary
Fixes #1915.
Verification